//
//  ClubSystemNews.m
//  SelfDrivingTravelling-IOS
//
//  Created by Teplot_01 on 16/8/19.
//  Copyright © 2016年 Teplot_01. All rights reserved.
//

#import "ClubSystemNews.h"
#import "ClubSystemNewsCell.h"
@interface ClubSystemNews ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation ClubSystemNews

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = LighterGrayColor;
    self.title = @"系统消息";
    [self initTableViewWithClubSystemNews];
}
- (void)initTableViewWithClubSystemNews{
    UITableView *_tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.backgroundColor = LighterGrayColor;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_tableView];
}
#pragma - mark UITabelViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 5;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    ClubSystemNewsCell *cell = [[NSBundle mainBundle]loadNibNamed:@"ClubSystemNewsCell" owner:nil options:nil][0];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.detail.tintColor = Theme_Color;
    cell.agree.backgroundColor = Theme_Color;
    cell.agree.tintColor = White_Color;
    cell.agree.layer.cornerRadius = 3;
    cell.refuse.backgroundColor = Orange_Color;
    cell.refuse.tintColor = White_Color;
    cell.refuse.layer.cornerRadius = 3;
    return cell;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, KScreenWidth, 20)];
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,13,KScreenWidth,15)];
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:12];
    label.textColor = Gray_Color;
    label.text = @"2016-8-15";
    [customView addSubview:label];
    return customView;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 30;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0.01;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
